package cn.itsource.pet.mapper;

import cn.itsource.pet.domain.OrderPetAcquisition;
import cn.itsource.pet.domain.Pet;
import cn.itsource.pet.domain.PetType;
import cn.itsource.pet.query.PetQuery;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface PetMapper extends Mapper<Pet> {

    List<Pet> findPage(PetQuery petQuery);

    List<Pet> findHome(PetQuery petQuery);
    @Select("select * from t_pet where id=#{petId}")
    Pet getPrice(Long petId);

    @Select("select  tpt.*,count(1) count  from  t_pet_type tpt LEFT JOIN t_pet tp on tp.type_id=tpt.id GROUP BY tp.type_id")
    List<PetType> selectForm();
    @Select("select  tp.resource_type name,count(1) value  from t_pet tp  GROUP BY tp.resource_type")
    List<Pet> selectPet();
}
